home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / mac / DirectX SDK / DXSDK / samples / Multimedia / VBSamples / DirectPlay / DataRelay / readme.txt < prev    next >
Text File  |  2001-10-10  |  3KB  |  62 lines

  1. //-----------------------------------------------------------------------------
  2. // 
  3. // Sample Name: DataRelay Sample
  4. // 
  5. // Copyright (C) 1999-2001 Microsoft Corporation. All rights reserved.
  6. // 
  7. //-----------------------------------------------------------------------------
  8.  
  9.  
  10. Description
  11. ===========
  12.   The DataRelay is similar to SimplePeer but differs by sending a single 
  13.   target (or everyone) a packet of data with options specified in the 
  14.   dialog's UI. 
  15.  
  16. Path
  17. ====
  18.   Source: DXSDK\Samples\Multimedia\VBSamples\DirectPlay\DataRelay 
  19.  
  20.   Executable: DXSDK\Samples\Multimedia\VBSamples\DirectPlay\Bin
  21.  
  22. User's Guide
  23. ============
  24.   Host or connect to a session in the same manner as explained in SimplePeer.
  25.   When the main dialog appears select the target, size, rate, and timeout values.
  26.   Then click "Push to Send". This will send a packet of data to the target as
  27.   the rate specified with the specified size.
  28.  
  29. Programming Notes
  30. =================
  31.   The DataRelay sample is very similar in form to the SimplePeer sample.  For 
  32.   detailed programming notes on the basics this sample, refer to Programming 
  33.   Notes section of the SimplePeer sample.
  34.  
  35.   The DataRelay differs by sending a single target (or everyone) a packet of 
  36.   data with options specified in the dialog's UI. 
  37.  
  38.   When the "Push to Send" button is clicked, a timer goes off every number of 
  39.   ms according to the UI and sends data.
  40.  
  41.   * When the timer notices it's time to send data, it does the following:
  42.     1. Creates a byte array with the options specified in the UI.
  43.     2. DirectPlay8Peer.SendTo is called passing in the byte array.  We 
  44.            call SendTo with the flags DPNSEND_NOLOOPBACK.  DPNSEND_NOLOOPBACK tells
  45.        DirectPlay to not to send the buffer to us.
  46.     
  47.   * Handle DirectPlay system messages.  See implemented DirectPlay8Event interfaces
  48.         The DataRelay handles the typical messages as described in the 
  49.         SimplePeer programming notes, and in addition:
  50.         
  51.         - Upon Receive event
  52.             1. Gets the message type from the received byte array.
  53.             2. It then selects off the message type. 
  54.             3. If its a MSG_GamePacket, then it adds the data to a collection,
  55.                where a timer will notice the data and process it.  This is important
  56.                so the DirectPlay threads stay working atfull speed.
  57.  
  58.         - Upon DPN_MSGID_SEND_COMPLETE
  59.             1. It checks the dpnotify.hResultCode for DPNERR_TIMEDOUT.
  60.             2. If this occurs then it updates the UI.
  61.          
  62.